using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace PaulRz.Util.Patterns
{
    public abstract class ConsumerPipelineElement<TInput> : PipelineElement<TInput, NullIOType>
        where TInput : class
    {
        protected ConsumerPipelineElement(string name, ILogInterface logger, int joinTime) : base(name, logger, joinTime)
        {
        }

        protected abstract void ProcessInput(TInput message);
        
        protected override void ProcessCycle()
        {
            TInput message = Input.Dequeue();
            ProcessInput(message);
        }
    }
}
